﻿using Microsoft.Practices.Unity;
using NTQOnlineExam.Services.CommandService;
using NTQOnlineExam.Services.CommandService.Account;
using NTQOnlineExam.Services.CommandService.Answer;
using NTQOnlineExam.Services.CommandService.Email;
using NTQOnlineExam.Services.CommandService.Examination;
using NTQOnlineExam.Services.CommandService.Payment;
using NTQOnlineExam.Services.CommandService.Question;
using NTQOnlineExam.Services.EntityFW.Entity;
using NTQOnlineExam.Services.EntityFW.Repository;
using NTQOnlineExam.Services.Infrastructure;
using NTQOnlineExam.Services.Infrastructure.Encryption;
using NTQOnlineExam.Services.ReportService.Account;
using NTQOnlineExam.Services.ReportService.Answer;
using NTQOnlineExam.Services.ReportService.Basket;
using NTQOnlineExam.Services.ReportService.Examination;
using NTQOnlineExam.Services.ReportService.Order;
using NTQOnlineExam.Services.ReportService.Portfolio;
using NTQOnlineExam.Services.ReportService.Question;
using NTQOnlineExam.Services.ReportService.Section;
using NTQOnlineExam.Services.ReportService.Term;
using NTQOnlineExam.Services.ReportService.Year;

namespace NTQOnlineExam.Services
{
    public class ServiceComponentsRegister
    {
        public static void RegisterServicesComponents(IUnityContainer container)
        {
            container.RegisterType<ICommandExecutor, CommandExecutor>();
            container.RegisterType<IQuestionReportService, QuestionReportService>();
            container.RegisterType<IAnswerReportService, AnswerReportService>();
            container.RegisterType<ISectionReportService, SectionReportService>();
            container.RegisterType<ISectionCommandService, SectionCommandService>();
            container.RegisterType<IAnswerCommandService, AnswerCommandService>();
            container.RegisterType<IQuestionCommandService, QuestionCommandService>();
            container.RegisterType<IExaminationCommandService, ExaminationCommandService>();
            container.RegisterType<IExaminationReportService, ExaminationReportService>();
            container.RegisterType<ITermReportService, TermReportService>();
            container.RegisterType<ITermCommandService, TermCommandService>();
            container.RegisterType<IAccountCommandService, AccountCommandService>();
            container.RegisterType<IAccountReportService, AccountReportService>();
            container.RegisterType<IPaymentCommandService, PaymentCommandService>();
            container.RegisterType<IBasketCommandService, BasketCommandService>();
            container.RegisterType<IBasketReportService, BasketReportService>();
            container.RegisterType(typeof(IGenericRepository<Term>), typeof(GenericRepository<Term>));
            container.RegisterType(typeof(IGenericRepository<Basket>), typeof(GenericRepository<Basket>));
            container.RegisterType(typeof(IGenericRepository<BasketItem>), typeof(GenericRepository<BasketItem>));
            container.RegisterType(typeof(IGenericRepository<Order>), typeof(GenericRepository<Order>));
            container.RegisterType(typeof(IGenericRepository<UserProfile>), typeof(GenericRepository<UserProfile>));
            container.RegisterType(typeof(IGenericRepository<OrderDetail>), typeof(GenericRepository<OrderDetail>));
            container.RegisterType(typeof(IGenericRepository<Portfolio>), typeof(GenericRepository<Portfolio>));
            container.RegisterType(typeof(IOrderCommandService), typeof(OrderCommandService));
            container.RegisterType(typeof(IUnitOfWork), typeof(UnitOfWork));
            container.RegisterType(typeof(IPortfolioReportService), typeof(PortfolioReportService));
            container.RegisterType(typeof(IOrderPaymentInfoFactory), typeof(OrderPaymentInfoFactory));
            container.RegisterType(typeof(IPortfolioCommandService), typeof(PortfolioCommandService));
            container.RegisterType(typeof(IOrderReportService), typeof(OrderReportService));
            container.RegisterType(typeof(IEmailService), typeof(EmailService));
            container.RegisterType(typeof(IEncryptionService), typeof(SimpleAESEncryptionService));
            container.RegisterType(typeof(IYearReportService), typeof(YearReportService));
            container.RegisterType(typeof(IContentCommandService), typeof(ContentCommandService));
        }
    }
}
